home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 2.iso / STUTTGART / LANG / ADA / GNAT / !gcc / adainc / 3 / ads / a-wtiopi < prev    next >
Text File  |  1996-02-12  |  3KB  |  86 lines

  1. ------------------------------------------------------------------------------
  2. --                                                                          --
  3. --                         GNAT RUNTIME COMPONENTS                          --
  4. --                                                                          --
  5. --            A D A . W I D E _ T E X T _ I O . P I C T U R E S             --
  6. --                                                                          --
  7. --                                 S p e c                                  --
  8. --                                                                          --
  9. --                            $Revision: 1.7 $                              --
  10. --                                                                          --
  11. -- This specification is adapted from the Ada Reference Manual for use with --
  12. -- GNAT.  In accordance with the copyright of that document, you can freely --
  13. -- copy and modify this specification,  provided that if you redistribute a --
  14. -- modified version,  any changes that you have made are clearly indicated. --
  15. --                                                                          --
  16. ------------------------------------------------------------------------------
  17.  
  18. package Ada.Wide_Text_IO.Pictures is
  19.  
  20.    type Picture is private;
  21.  
  22.    function Valid (Item : in String) return Boolean;
  23.  
  24.    function To_Picture (Item : in String) return Picture;
  25.  
  26.    function To_String (Item : in Picture) return String;
  27.  
  28.    Max_Picture_Length : constant := 30;
  29.  
  30.    Picture_Error : exception;
  31.  
  32.    --  Localization features:
  33.  
  34.    Max_Currency_Length : constant := 10;
  35.  
  36.    subtype Currency_Length_Range is
  37.      Integer range 1 .. Max_Currency_Length;
  38.  
  39.    type Locale (Length : Currency_Length_Range := 1) is record
  40.       Currency    : Wide_String (1 .. Length) := "$";
  41.       Fill        : Wide_Character            := '*';
  42.       Separator   : Wide_Character            := ',';
  43.       Radix_Mark  : Wide_Character            := '.';
  44.    end record;
  45.  
  46.    generic
  47.       type Num is delta <> digits <>;
  48.  
  49.    package Edited_Output is
  50.  
  51.       Default_Locale  : Locale;
  52.  
  53.       function Length (Pic     : in Picture;
  54.                        Symbols : in Locale := Default_Locale)
  55.         return Natural;
  56.  
  57.       function Image (Item    : in Num;
  58.                       Pic     : in Picture;
  59.                       Symbols : in Locale  := Default_Locale)
  60.         return Wide_String;
  61.  
  62.       procedure Put (File    : in File_Type;
  63.                      Item    : in Num;
  64.                      Pic     : in Picture;
  65.                      Symbols : in Locale  := Default_Locale);
  66.  
  67.       procedure Put (Item    : in Num;
  68.                      Pic     : in Picture;
  69.                      Symbols : in Locale  := Default_Locale);
  70.  
  71.       procedure Put (To      : out Wide_String;
  72.                      Item    : in Num;
  73.                      Pic     : in Picture;
  74.                      Symbols : in Locale  := Default_Locale);
  75.  
  76.    end Edited_Output;
  77.  
  78. private
  79.  
  80.    type Picture is record
  81.       Length : Natural;
  82.       Data   : String (1 .. 30);
  83.    end record;
  84.  
  85. end Ada.Wide_Text_IO.Pictures;
  86.